Skip to content

🌱 Rename ClusterObjectSet secret cucumber steps for clarity#2622

Merged
openshift-merge-bot[bot] merged 1 commit intooperator-framework:mainfrom
pedjak:rename-cos-cucumber-steps
Apr 2, 2026
Merged

🌱 Rename ClusterObjectSet secret cucumber steps for clarity#2622
openshift-merge-bot[bot] merged 1 commit intooperator-framework:mainfrom
pedjak:rename-cos-cucumber-steps

Conversation

@pedjak
Copy link
Copy Markdown
Contributor

@pedjak pedjak commented Apr 1, 2026

Description

Rename ClusterObjectSet e2e cucumber steps from internal terminology ("refs", "ref Secrets") to more descriptive names and extract a shared matchLabels helper.

Step renames

Old New
phase objects use refs phase objects are managed in Kubernetes secrets
ref Secrets exist in "..." namespace referred secrets exist in "..." namespace
ref Secrets are immutable referred secrets are immutable
ref Secrets are labeled with revision and owner referred secrets contain labels
ref Secrets have ownerReference to the revision referred secrets are owned by the object set
ref Secrets have type "..." referred secrets have type "..."

The "contain labels" step now uses a data table (like ResourceHasLabels) instead of hardcoded label keys, and both steps share a matchLabels helper.

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

Copilot AI review requested due to automatic review settings April 1, 2026 14:46
@openshift-ci openshift-ci bot requested review from ankitathomas and fgiudici April 1, 2026 14:46
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 1, 2026

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 38c03ac
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/69cd43b414c1840008f5334c
😎 Deploy Preview https://deploy-preview-2622--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Renames ClusterObjectSet “ref Secrets/refs” cucumber steps to clearer “referred secrets” terminology and factors label-matching logic into a shared helper.

Changes:

  • Renamed several ClusterObjectSet e2e step definitions and updated the install feature accordingly.
  • Updated the “labels” step to accept a data table for expected labels.
  • Added a shared matchLabels helper and reused it in ResourceHasLabels.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/e2e/steps/steps.go Renames step functions/patterns, adds matchLabels, and updates label-verification logic to use a data table + helper.
test/e2e/features/install.feature Updates scenario steps to the new “referred secrets” wording and supplies label expectations via a data table.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1795 to +1804
// matchLabels checks that actual labels contain all expected key-value pairs.
// Returns the first mismatched key, the actual value, and false if a mismatch is found.
func matchLabels(actual, expected map[string]string) (key, got string, ok bool) {
for k, v := range expected {
if a, found := actual[k]; !found || a != v {
return k, a, false
}
}
return "", "", true
}
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The helper’s “first mismatched key” is nondeterministic because Go map iteration order is random, which can make logs/flakes harder to reproduce. Consider iterating over a stable ordering of keys (e.g., sort the expected keys before checking) so failures are deterministic and easier to debug.

Copilot uses AI. Check for mistakes.
Comment on lines +820 to +831
waitFor(ctx, func() bool {
secrets, err := listReferredSecrets(ctx, revisionName)
if err != nil || len(secrets) == 0 {
return false
}
ownerLabel := s.Labels["olm.operatorframework.io/owner-name"]
if expectedOwner != "" && ownerLabel != expectedOwner {
return fmt.Errorf("secret %s/%s has owner-name label %q, expected %q", s.Namespace, s.Name, ownerLabel, expectedOwner)
for _, s := range secrets {
if _, _, ok := matchLabels(s.Labels, expected); !ok {
return false
}
}
}
return true
})
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When label matching fails, the retry loop returns false without emitting any diagnostic signal about which secret failed or which key/value mismatched. Since waitFor will eventually fail with a generic timeout, debugging can be unnecessarily difficult; consider logging the secret name/namespace and the mismatched label key (and expected vs got) on mismatch (similar to the ResourceHasLabels logging).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

I am ok with this one.
We might just want to ensure that we address the nit comments from Copilot
All great !!

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 1, 2026
Rename "ref Secrets/refs" step definitions to "referred secrets" for
better readability. Update the labels step to accept a data table and
extract a shared matchLabels helper with deterministic key ordering.
Add diagnostic logging when label matching fails during polling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.88%. Comparing base (95ef574) to head (38c03ac).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2622      +/-   ##
==========================================
+ Coverage   68.86%   68.88%   +0.02%     
==========================================
  Files         139      139              
  Lines        9902     9902              
==========================================
+ Hits         6819     6821       +2     
+ Misses       2572     2571       -1     
+ Partials      511      510       -1     
Flag Coverage Δ
e2e 37.42% <ø> (-0.24%) ⬇️
experimental-e2e 52.27% <ø> (+0.02%) ⬆️
unit 53.53% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are just renaming things
I think it is totally fine to move forward.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 2, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 2, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 735b41e into operator-framework:main Apr 2, 2026
25 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. go-apidiff-override lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants